@{
    string objID = Guid.NewGuid().ToString().Substring(0, 5);
    Ajax.Dna().Widget()
        .UserPreferences(@<text>
    @{ string _url = item.UserPreferences["Url"] != null ? item.UserPreferences["Url"].ToString() : ""; }
    <div>
        Url</div>
    <div style="overflow: hidden;">
        @{ Ajax.Dna().TextBox(item.GenerateFieldID("Url")).Value(_url).Render();  }
    </div>
    <div style="overflow: hidden; margin-top: 5px;">
        Width</div>
    <div style="overflow: hidden;">
        @{ Ajax.Dna().Number(item.GenerateFieldID("Width"), item.GetInt("Width")).Render(); }
    </div>
    <div>
        Height</div>
    <div>
        @{ Ajax.Dna().Number(item.GenerateFieldID("Height"), item.GetInt("Height")).Render(); }
    </div>
    <div>
        @item.PropertyDescriptors["WMODE"].DisplayName</div>
    <div>
        @{
            Ajax.Dna().ComboBox(item.GenerateFieldID("WMODE"))
                .Select(item.UserPreferences["WMODE"].ToString())
                .Items(items =>
                {
                    items.AddValue("window", "window");
                    items.AddValue("opaque", "opaque");
                    items.AddValue("transparent", "transparent");
                })
                .Render();
        }
    </div>
    <div>
        @item.PropertyDescriptors["Quality"].DisplayName</div>
    <div>
        @{
            Ajax.Dna().ComboBox(item.GenerateFieldID("Quality"))
                .Items(items =>
           {
               items.AddValue("low", "low");
               items.AddValue("autolow", "autolow");
               items.AddValue("autohigh", "autohigh");
               items.AddValue("medium", "medium");
               items.AddValue("high", "high");
               items.AddValue("best", "best");
           })
           .Render();
        }
    </div>
    <div>
        @item.PropertyDescriptors["FlashVars"].DisplayName
    </div>
    <div>
        @{
            Ajax.Dna().TextBox(item.GenerateFieldID("FlashVars"))
                .Value(item.UserPreferences["FlashVars"] != null ? item.UserPreferences["FlashVars"].ToString() : "")
                .Render();
        }
    </div>
    </text>)
        .Content(@<text>
    @{
        string _url = item.UserPreferences["Url"] != null ? item.UserPreferences["Url"].ToString() : "";
        string _file = string.IsNullOrEmpty(_url) ? "" : (VirtualPathUtility.IsAbsolute(_url) ? VirtualPathUtility.GetFileName(_url) : _url);
        string _bgcolor = item.UserPreferences["BackgroundColor"].ToString();
    }
    @if (string.IsNullOrEmpty(_url))
    { 
        <div class="dna-state-info">
            Please set the Flash object url.</div>
    }
    else
    { 
        <object id="@objID" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0"
    width="@item.UserPreferences["Width"].ToString()" height="@item.UserPreferences["Height"].ToString()">
            <param name="movie" value="@_file" />
            <param name="quality" value="@item.UserPreferences["Quality"].ToString()" />
            <param name="bgcolor" value="@_bgcolor" />
            <embed name="@objID" src="@_url" quality="@item.UserPreferences["Quality"].ToString()"
        bgcolor="@_bgcolor" width="@item.UserPreferences["Width"].ToString()"
        height="@item.UserPreferences["Height"].ToString()" align="" type="application/x-shockwave-flash"
        pluginspage="http://www.macromedia.com/go/getflashplayer">
        </embed>
        </object>
    }
    </text>)
        .Render();
}
